package com.xu.sso.db.service;


import com.xu.sso.db.model.base.AppRole;

import java.util.List;

public interface RoleDBService {

    List<AppRole> findRolesByApp(String appId);

    List<AppRole> findInAppRoles(String appId, String username);

    List<AppRole> findNotInAppRoles(String appId, String username);

    List<AppRole> findInResRolesByResId(String appId, Integer resId);

    List<AppRole> findNotInResRolesByResId(String appId, Integer resId);

    AppRole findAppRoleById(Integer id);

    boolean checkAppRoleExist(String appId, String roleName);

    int createAppRole(AppRole appRole);

    int createAppUserRoles(List<Integer> roleIds, String appId, String username);

    int createResourcesRoles(List<Integer> roleIds, String appId, Integer resId);

    int deleteAppRoleById(Integer id);

    int deleteAppRoleByApp(String appId);

    int deleteAppUserRoles(List<Integer> roleIds, String appId, String username);

    int deleteAppUserRolesByApp(String appId);

    int deleteAppUserRolesByAppUser(String appId, String username);

    int deleteAppUserRolesByUser(String username);

    int deleteAppUserRolesByRoleId(Integer roleId);

    int deleteResourcesRole(List<Integer> roleIds, String appId, Integer resId);

    int deleteResourcesRoleByAppId(String appId);

    int deleteResourcesRoleByResId(Integer resId);

    int deleteResourcesRoleByRoleId(Integer roleId);

    int updateAppRole(AppRole appRole);

    int updateAppRoleStatus(Integer id, String status);

}
